package com.hlmc.service;

import com.hlmc.dao.Zy2Dao;
import com.hlmc.entity.Zy2;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service("zy2Service")
public class Zy2Service implements Zy2Dao {
    @Resource
    private Zy2Dao zy2Dao;

    @Override
    public int AddZy2(Zy2 dt) {
        zy2Dao.AddZy2(dt);
        return 0;
    }

    @Override
    public List<Zy2> findZy2(Map<String,String> map) {
        List<Zy2> lists=new ArrayList<Zy2>();
        lists=zy2Dao.findZy2(map);
        return lists;
    }

    @Override
    public Zy2 findZy2ByImg(String image) {
        Zy2 zt=new Zy2();
        zt=zy2Dao.findZy2ByImg(image);
        return zt;
    }

    @Override
    public List<Zy2> findZy2ByCategory(Map<String,Object>map) {
        List<Zy2> lists=new ArrayList<Zy2>();
        lists=zy2Dao.findZy2ByCategory(map);
        return lists;
    }

    @Override
    public int findTotalNum(String category) {
        int totalNum=0;
        totalNum=zy2Dao.findTotalNum(category);
        return totalNum;
    }
}
